Creating Attributes

I have a question on creating object attributes.  The code that I am using creates the attribute, but I also would like to add description text to the attribute.  I can do this manually after the fact, but cannot see how to do this with the attribute creat command.  The code I am using is the following

      create object type AttributeType history boolGenerateHistory changeBars boolChangeBars date boolChangeDates //-
      inherit false hidden false multi boolMultiValue attribute newAttribute (default DefaultValue)

What am i missing?

Thanks in advance!


Mike.P.Adams - Thu Feb 19 14:33:23 EST 2015

Re: Creating Attributes
BillTidy - Thu Feb 19 16:06:49 EST 2015

Isn't 'description' just another property you can set, like...           description myDescription

Re: Creating Attributes
Martin_Hunter - Tue Feb 24 09:39:59 EST 2015

Mike,

You can assign multiple properties, eg type, description, history, changeBars, etc, therefore your code would become:

create object type AttributeType description myDescription history boolGenerateHistory changeBars boolChangeBars date boolChangeDates //-
      inherit false hidden false multi boolMultiValue attribute newAttribute (default DefaultValue)

-Martin

Re: Creating Attributes
Mike.P.Adams - Tue Feb 24 10:05:36 EST 2015

That works - thanks.  However, since doing this , I noticed that some of the attributes that I need to create need to run a DXL.  I see that there is the attribute property 'dxl'.  This does not appear to work the same way.  From reading the DXL Help manual, it states that the code needs to be included when creating the attribute.  The code that is to be attached is lenghty.  Is there not a way to enter the DXL filename instead? 

In either case, when playing with this option, after the attribute is created, when I edit the attribute the box 'DXL attribute' is not checked as expected (when I played with this, I entered very simple code to test).

Re: Creating Attributes
Wolfgang Uhr - Tue Feb 24 10:57:11 EST 2015

Mike.P.Adams - Tue Feb 24 10:05:36 EST 2015

That works - thanks.  However, since doing this , I noticed that some of the attributes that I need to create need to run a DXL.  I see that there is the attribute property 'dxl'.  This does not appear to work the same way.  From reading the DXL Help manual, it states that the code needs to be included when creating the attribute.  The code that is to be attached is lenghty.  Is there not a way to enter the DXL filename instead? 

In either case, when playing with this option, after the attribute is created, when I edit the attribute the box 'DXL attribute' is not checked as expected (when I played with this, I entered very simple code to test).

Hi

No you must not define and insert the dxl-code while you create an attribute. You can use modify instead of this

string sValue = "Some DxlCode"
attrDef = modify(attrDef, setDXL, sValue);

And no, you cannot use a file reference, but you can use an include command;
string sValue = "#include <SomePath/SomeFile.dxl>"
attrDef = modify(attrDef, setDXL, sValue);

But this means that you will get some trouble in form of a lot of firing error messages, if you open the module and the file does not exist.

Best regards
Wolfgang

 

Re: Creating Attributes
Mike.P.Adams - Tue Feb 24 11:02:18 EST 2015

Thanks!  This looks like this will work.  I will try this and see how it goes.  Thanks again!